home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / tegl6b.zip / INTROPAK.EXE / lha / TWWSAM.PAS < prev    next >
Pascal/Delphi Source File  |  1991-04-06  |  2KB  |  74 lines

  1. {-- a simple window with a world coordinate system, the items are }
  2. {-- redrawn and fitted to the window when it is resized. }
  3.  
  4. {$M 4384,64000,256000}
  5. {$I switches.inc}
  6.  
  7. USES
  8.  
  9.   teglfont,
  10.   FastGrph,
  11.   TGraph,
  12.   virtmem,
  13.   teglmain,
  14.   teglunit,
  15.   twcommon,
  16.   twkernel,
  17.   twworld,
  18.   moreicon;
  19.  
  20. {$F+}
  21. {$IFDEF wcFloatLInt}
  22. Function worldredraw(ifs : ImageStkPtr; ms : MsClickPtr): Word;
  23.   VAR wf : WinFramePtr;
  24.   BEGIN
  25.     wf := FindWinFrame(ifs);
  26.     twwDefineWorld(wf,-10000,10000,10000,-10000);
  27.     twwLine(wf,-10000,-10000, 10000,10000);
  28.     twwrectangle(wf,-5000,-5000,5000,5000);
  29.     setfillstyle(solidfill,blue);
  30.     twwbar(wf,-9000,9000,-5000,5000);
  31.     twwarc(wf,0,0,180,360,5000);
  32.     twwellipse(wf,0,0,180,360,4000,4000);
  33.     twwcircle(wf,0,0,6000);
  34.   END;
  35.  
  36.  
  37. {$ELSE}  {-- assume reals }
  38.  
  39. Function worldredraw(ifs : ImageStkPtr; ms : MsClickPtr): Word;
  40.   VAR wf : WinFramePtr;
  41.   BEGIN
  42.     wf := FindWinFrame(ifs);
  43.     twwDefineWorld(wf,-10.0,10.0,10.0,-10.0);
  44.     twwLine(wf,-10.0,-10.0, 10.0,10.0);
  45.     twwrectangle(wf,-5,-5,5,5);
  46.     setfillstyle(solidfill,blue);
  47.     twwbar(wf,-9,9,-5,5);
  48.     twwarc(wf,0,0,360,180,5.0);
  49.     twwellipse(wf,0,0,180,360,4.0,4.0);
  50.     twwcircle(wf,0,0,6.0);
  51.   END;
  52.  
  53. {$ENDIF}
  54.  
  55. VAR wf : WinFramePtr;
  56.  
  57. BEGIN
  58.   twEasyStart;
  59.   EmergencyExit;
  60.   setautorotate(true);
  61.   SetTeglFont(@Font14);
  62.   {---------}
  63.   New(wf);
  64.   twInit(wf,100,100,400,300);
  65.   twSetThickness(wf,6);
  66.   twSetWinFrameColors(wf,lightgray,darkgray);
  67.   twSetHeader(wf,'World Window');
  68.   twSetRedraw(wf,worldredraw);
  69.   twDrawWindowFrame(wf);
  70.  
  71.   SetAutoRotate(TRUE);
  72.   TeglSuperVisor;
  73. END.
  74.